import 'package:get/get.dart';
import 'package:klfz_flutter/http/http_utils.dart';
import 'package:klfz_flutter/model/chapter_result.dart';
import 'package:klfz_flutter/model/novel_result.dart';

class BookDetailLogic extends GetxController {
  List<Chapter> chapters = [];
  //加载章节列表
  loadData(Novel novel) {
    HttpUtils.get("/novel/novelChapter/chapters?id=${novel.id}").then((value) {
      var result = ChapterResult.fromJson(value);
      if (result != null && result.code == 200) {
        chapters = result.result!;
      }
      update();
    });

  }
}
